package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;


/**
 * 退款状态
 */
@AllArgsConstructor
@Getter
public enum EnumReturnStatus {
  //0:待审核 1：退款中 2：退款完成 3：退款失败
     RETURN_AUDIT(0, "审核中"),

	RETURN_RUN(1, "退款中"),

	RETURN_SUCCESS(2, "退款成功"),

	RETURN_FAIL(3, "退款失败"),
	;

	private Integer code;

	private String name;

	public static EnumReturnStatus getByCode(Integer code) {
		if(null == code) {
			return null;
		}
		for(EnumReturnStatus auditStatusEnum : EnumReturnStatus.values()) {
			if(auditStatusEnum.getCode() == code) {
				return auditStatusEnum;
			}
		}
		return null;
	}

}
